package org.cms.nio.util;

import java.io.IOException;
import java.nio.channels.SocketChannel;
import org.cms.nio.Connection;
import org.cms.nio.FrontendConnection;
import org.cms.nio.handler.FrontConnectionHandler;
import org.cms.nio.handler.NIOHandler;

/**
 * @Description: 
 * @Department:
 * @author andy.lhc
 * @date 2016年6月2日 上午11:42:35 
 */
public class FrontendConnectionFactory extends ConnectionFactory {

  private NIOHandler<FrontendConnection> handler = new FrontConnectionHandler();

  @Override
  protected Connection makeConnection(SocketChannel channel) throws IOException {
      FrontendConnection con = new FrontendConnection(channel);
      // con.setPrivileges(MycatPrivileges.instance());
      // con.setCharset("UTF-8");
      // con.setLoadDataInfileHandler(new ServerLoadDataInfileHandler(c));
      // c.setPrepareHandler(new ServerPrepareHandler(c));
      // con.setTxIsolation(sys.getTxIsolation());
      return con;
  }

  @Override
  protected NIOHandler<FrontendConnection> getNIOHandler() {
      return handler;
  }

}
